﻿using CoreProject.IRepository;
using CoreProject.Model;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;

namespace CoreProject.Repository
{
    public class PderxqRepository:BaseRepository<Pderxq>,IPderxqRepository
    {
        private readonly EFDbContext _eFDbContext;

        public PderxqRepository(EFDbContext eFDbContext ):base(eFDbContext)
        {
            _eFDbContext = eFDbContext;
        }

       

        public async Task<List<Pderxq>> cha(Expression<Func<Pderxq, bool>> whereLambda)
        {
            return await _eFDbContext.Set<Pderxq>() .Include(n=>n.GIdNavigation).Include(n=>n.PbhNavigation)          
            .Where(whereLambda).ToListAsync();
        }

        public async Task<bool> jiaq(List<Pderxq> t)
        {

            _eFDbContext.Pderxqs.AddRange(t);

            return _eFDbContext.SaveChanges() > 0;
        }


    }
}
